<style>
.rt_content{background-color: #FFF;padding: 20px;}
</style>
<div class="page_title">
    <h2 class="fl">{$pageTitle}</h2>
</div>
<section>
    <ul class="ulColumn2">
        <li>
            <span class="item_name" style="width:120px;">公告内容：</span>
            <div style="display: inline-flex;">
                <textarea placeholder="你可以在这里编写公共内容" id="textarea-notice" class="textarea" name="notice" style="width:500px;height:100px;">{$info.value.text}</textarea>
            </div>
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>公告指观众进入直播间后的系统消息,不超过100个汉字,为空表示不设置</div>
        </li>
        <li>
            <span class="item_name" style="width:120px;">状态：</span>
            <input type="checkbox" id="checkbox_d1" class="chk_4" {eq name="info.status" value="1"}checked{/eq} />
            <label for="checkbox_d1">
                <input type="hidden" name="status" value="{$info.status}"/>
            </label>
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>设置为关闭,将不会发送公告</div>
        </li>
        <li>
            <span class="item_name" style="width:120px;"></span>
            <input type="submit" id="submit" class="link_btn" value="保存"/>
        </li>
    </ul>
</section>
<script>
$(function(){
    $("#submit").click(function(){
        var send_data = {
              url:U('admin/Stream/edit_notice'),
              type:'POST',
              data:{
                  config_id:'{:encrypt_id($info.config_id)}',
                  status:$('input[name="status"]').val() == '1' ? 1 : 0,
                  notice:$("textarea[name='notice']").val()
              }
        };
        send_ajax(send_data,function(res){
            if(res.status == 1){
                msg_success(res.data.info,'',1000);
                setTimeout(function(){
                    admin.getContentByUrl(res.data.jumpurl);
                },1000);
            }else{
                msg_error(res.message);
            }
        })
    })
});
</script>